
import ParserError from "@/js/GraphParser/src/ParserError"
import { DefaultLayout, GraphNode } from "@/js/components/GraphNode"
import { GraphView } from "@/js/components/GraphView"
import { InputLinkNodeBoolean, InputLinkNodeFlow } from "@/js/components/InputLinkNode"

export class Main extends GraphNode{
    layout?: DefaultLayout
    load(){
        super.load()

        const layout = new this.DefaultLayout(this, this.graphView as GraphView, false, true, '#7f0000')
        this.layout = layout
        this.appendChild(layout.container)
        layout.container.removeChild(layout.mainContainer)

        layout.main?.right.appendChild(new InputLinkNodeFlow(this, this.graphView as GraphView, {
            name: "true", 
            desc: '真',
            model: "output",
            showInput: false,
        }))
    }
}

Main.parser = ({next, node }) => {
    const nextCode = next(node.outputs.output)
    return nextCode
}